import React from 'react'
import Control from './Control'
import { Input } from '../../../ui-components'
import style from './style'

export default (props) => {
	return (
		<div className={style.editRoot}>
			<Input 
        autoFocus
				label="名称" 
				width={200}
				defaultValue={props.editFieldDisplayName} 
				onChange={(e) => props.update({ displayName: e.target.value })}
				disabled={props.noControl}
			/>
			{ props.children }
			{!props.noControl ? <Control {...props}/> : null}
		</div>
	)
}

export
class Base extends React.Component {

	update(args) {
    this.props.updateProfileTemplateFieldTitle(args)
	}

	render() {
		return React.DOM.noscript()
	}
}
